-
Notifications
You must be signed in to change notification settings - Fork 663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update source info #2418
Update source info #2418
Conversation
@mthrok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@@ -12,6 +12,8 @@ struct SrcStreamInfo { | |||
const char* codec_long_name = "N/A"; | |||
const char* fmt_name = "N/A"; | |||
int64_t bit_rate = 0; | |||
int64_t num_frames = 0; | |||
int bits_per_sample = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is int64_t
in stream_reader_wrapper.h, does this matter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not matter. It's int
type in libavcodec, but TorchBind does not handle int
but int64_t
, so at stream_reader_wrapper.h
, it is converted to int64_t
.
media_type=media_type, | ||
codec=codec_name, | ||
codec_long_name=codec_long_name, | ||
format=None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are these all set to None even if the stream info contains values for these parameters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What StreamReaderSourceStream
class represents is that "Hey this stream contains media other than video or audio".
There are several possible types falls in this category, but basically, we are not interested in them. StreamReader
's main interest is audio/video streams, so whatever other streams there, we are not interested. Also these values are set by us here, and for streams other than audio/video, the values are not set. It is a default value we set. So it's unnecessary to copy the data.
Add num_frames and bits_per_sample to match with the current `torchaudio.info` capability.
@mthrok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Hey @mthrok. |
Summary: This commit add fallback mechanism to `info` and `load` functions of sox_io backend. If torchaudio is compiled to use FFmpeg, and runtime dependencies are properly loaded, in case `info` and `load` fail, it fallback to FFmpeg-based implementation. Depends on pytorch#2416, pytorch#2417, pytorch#2418 Pull Request resolved: pytorch#2419 Differential Revision: D36740306 Pulled By: mthrok fbshipit-source-id: b933f5a55ec5f5bb8d6ec4abbf1ad796839258d0
Summary: This commit add fallback mechanism to `info` and `load` functions of sox_io backend. If torchaudio is compiled to use FFmpeg, and runtime dependencies are properly loaded, in case `info` and `load` fail, it fallback to FFmpeg-based implementation. Depends on pytorch#2416, pytorch#2417, pytorch#2418 Pull Request resolved: pytorch#2419 Differential Revision: D36740306 Pulled By: mthrok fbshipit-source-id: b933f5a55ec5f5bb8d6ec4abbf1ad796839258d0
Summary: This commit add fallback mechanism to `info` and `load` functions of sox_io backend. If torchaudio is compiled to use FFmpeg, and runtime dependencies are properly loaded, in case `info` and `load` fail, it fallback to FFmpeg-based implementation. Depends on pytorch#2416, pytorch#2417, pytorch#2418 Pull Request resolved: pytorch#2419 Differential Revision: D36740306 Pulled By: mthrok fbshipit-source-id: b933f5a55ec5f5bb8d6ec4abbf1ad796839258d0
Summary: This commit add fallback mechanism to `info` and `load` functions of sox_io backend. If torchaudio is compiled to use FFmpeg, and runtime dependencies are properly loaded, in case `info` and `load` fail, it fallback to FFmpeg-based implementation. Depends on pytorch#2416, pytorch#2417, pytorch#2418 Pull Request resolved: pytorch#2419 Differential Revision: D36740306 Pulled By: mthrok fbshipit-source-id: 91dfdd199959d83ce643ccc38cf163ce29fba55e
Summary: This commit add fallback mechanism to `info` and `load` functions of sox_io backend. If torchaudio is compiled to use FFmpeg, and runtime dependencies are properly loaded, in case `info` and `load` fail, it fallback to FFmpeg-based implementation. Depends on pytorch#2416, pytorch#2417, pytorch#2418 Pull Request resolved: pytorch#2419 Differential Revision: D36740306 Pulled By: mthrok fbshipit-source-id: 91dfdd199959d83ce643ccc38cf163ce29fba55e
Summary: This commit add fallback mechanism to `info` and `load` functions of sox_io backend. If torchaudio is compiled to use FFmpeg, and runtime dependencies are properly loaded, in case `info` and `load` fail, it fallback to FFmpeg-based implementation. Depends on pytorch#2416, pytorch#2417, pytorch#2418 Pull Request resolved: pytorch#2419 Differential Revision: D36740306 Pulled By: mthrok fbshipit-source-id: 91dfdd199959d83ce643ccc38cf163ce29fba55e
Summary: This commit add fallback mechanism to `info` and `load` functions of sox_io backend. If torchaudio is compiled to use FFmpeg, and runtime dependencies are properly loaded, in case `info` and `load` fail, it fallback to FFmpeg-based implementation. Depends on pytorch#2416, pytorch#2417, pytorch#2418 Pull Request resolved: pytorch#2419 Differential Revision: D36740306 Pulled By: mthrok fbshipit-source-id: 91dfdd199959d83ce643ccc38cf163ce29fba55e
Summary: This commit add fallback mechanism to `info` and `load` functions of sox_io backend. If torchaudio is compiled to use FFmpeg, and runtime dependencies are properly loaded, in case `info` and `load` fail, it fallback to FFmpeg-based implementation. Depends on pytorch#2416, pytorch#2417, pytorch#2418 Pull Request resolved: pytorch#2419 Differential Revision: D36740306 Pulled By: mthrok fbshipit-source-id: 91dfdd199959d83ce643ccc38cf163ce29fba55e
Summary: This commit add fallback mechanism to `info` and `load` functions of sox_io backend. If torchaudio is compiled to use FFmpeg, and runtime dependencies are properly loaded, in case `info` and `load` fail, it fallback to FFmpeg-based implementation. Depends on pytorch#2416, pytorch#2417, pytorch#2418 Pull Request resolved: pytorch#2419 Differential Revision: D36740306 Pulled By: mthrok fbshipit-source-id: 91dfdd199959d83ce643ccc38cf163ce29fba55e
Summary: This commit add fallback mechanism to `info` and `load` functions of sox_io backend. If torchaudio is compiled to use FFmpeg, and runtime dependencies are properly loaded, in case `info` and `load` fail, it fallback to FFmpeg-based implementation. Depends on pytorch#2416, pytorch#2417, pytorch#2418 Pull Request resolved: pytorch#2419 Differential Revision: D36740306 Pulled By: mthrok fbshipit-source-id: 91dfdd199959d83ce643ccc38cf163ce29fba55e
Summary: This commit add fallback mechanism to `info` and `load` functions of sox_io backend. If torchaudio is compiled to use FFmpeg, and runtime dependencies are properly loaded, in case `info` and `load` fail, it fallback to FFmpeg-based implementation. BC-breaking changes: - FFmpeg does not report the number of frames for MP3, this is because MP3 does not store the information of the number of frames. It can be estimated from the audio duration and sample rate, but it might be inaccurate, so we keep it 0. Depends on - pytorch#2416 - pytorch#2417 - pytorch#2418 - pytorch#2423 - pytorch#2427 Pull Request resolved: pytorch#2419 Reviewed By: carolineechen Differential Revision: D36740306 Pulled By: mthrok fbshipit-source-id: 071d9441019b7e76bd9a7f44ed236333ca406be9
Summary: This commit add fallback mechanism to `info` and `load` functions of sox_io backend. If torchaudio is compiled to use FFmpeg, and runtime dependencies are properly loaded, in case `info` and `load` fail, it fallback to FFmpeg-based implementation. BC-breaking changes: - FFmpeg does not report the number of frames for MP3, this is because MP3 does not store the information of the number of frames. It can be estimated from the audio duration and sample rate, but it might be inaccurate, so we keep it 0. Depends on - #2416 - #2417 - #2418 - #2423 - #2427 Pull Request resolved: #2419 Reviewed By: carolineechen Differential Revision: D36740306 Pulled By: mthrok fbshipit-source-id: 9e2ad095b8b39e41404970de0d8d9b5aaa856c97
Add num_frames and bits_per_sample to match with the current
torchaudio.info
capability.